package com.itheima.collection;

import java.util.ArrayList;
import java.util.Collection;
import java.util.function.Predicate;

/*
Collection中的常用方法
 */
public class Demo01 {
    public static void main(String[] args) {
        Collection<String>  c= new ArrayList<>();
        c.add("坤坤");
        c.add("签签");
        c.add("滔滔");
        c.add("小鹿");
        c.add("小绵羊");

        c.removeIf(new Predicate<String>() {
            @Override
            public boolean test(String s) {
               // System.out.println(s);
                return s.length()==2;
            }
        });
       c.removeIf(s->s.length()==3);
        System.out.println(c);

    }

}
